package com.pengheng.common;

import com.pengheng.server.ServerHandler;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;

public class ServerChannelInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel socketChannel) throws Exception {
        //添加编解码
        socketChannel.pipeline().addLast(new MyDecoder());
        socketChannel.pipeline().addLast(new MyEncoder());
        socketChannel.pipeline().addLast(new ServerHandler());
    }
}